this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-collection"]=function(e){function t(t){for(var o,a,l=t[0],s=t[1],u=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&d.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(i&&i(t);d.length;)d.shift()();return n.push.apply(n,u||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],o=!0,l=1;l<c.length;l++){var s=c[l];0!==r[s]&&(o=!1)}o&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var o={},r={28:0},n=[];function a(t){if(o[t])return o[t].exports;var c=o[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.m=e,a.c=o,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(c,o,function(t){return e[t]}.bind(null,o));return c},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var i=s;return n.push([552,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.htmlEntities},102:function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var o=c(0),r=c(1),n=c(2),a=c(70),l=c(614),s=c(4),u=c.n(s),i=c(11),b=c(16),d=c(35),m=c(613),p=c(10);c(55);const g=({id:e,label:t,popoverContents:c,remove:l,screenReaderLabel:s,className:b=""})=>{const[d,O]=Object(o.useState)(!1),j=Object(i.useInstanceId)(g);if(s=s||t,!t)return null;t=Object(p.decodeEntities)(t);const f=u()("woocommerce-tag",b,{"has-remove":!!l}),w=`woocommerce-tag__label-${j}`,h=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},s),Object(o.createElement)("span",{"aria-hidden":"true"},t));return Object(o.createElement)("span",{className:f},c?Object(o.createElement)(n.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>O(!0)},h):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},h),c&&d&&Object(o.createElement)(n.Popover,{onClose:()=>O(!1)},c),l&&Object(o.createElement)(n.Button,{className:"woocommerce-tag__remove",onClick:l(e),label:Object(r.sprintf)(
// Translators: %s label.
Object(r.__)("Remove %s","woocommerce"),t),"aria-describedby":w},Object(o.createElement)(a.a,{icon:m.a,size:20,className:"clear-icon"})))};var O=g;c(54);const j=e=>Object(o.createElement)(d.b,{...e}),f=e=>{const{list:t,selected:c,renderItem:r,depth:n=0,onSelect:a,instanceId:l,isSingle:s,search:u,useExpandedPanelId:i}=e,[b]=i;return t?Object(o.createElement)(o.Fragment,null,t.map((t=>{var d,m;const p=null!==(d=t.children)&&void 0!==d&&d.length&&!s?t.children.every((({id:e})=>c.find((t=>t.id===e)))):!!c.find((({id:e})=>e===t.id)),g=(null===(m=t.children)||void 0===m?void 0:m.length)&&b===t.id;return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:p,onSelect:a,isSingle:s,selected:c,search:u,depth:n,useExpandedPanelId:i,controlId:l})),g?Object(o.createElement)(f,{...e,list:t.children,depth:n+1}):null)}))):null},w=({isLoading:e,isSingle:t,selected:c,messages:a,onChange:l,onRemove:s})=>{if(e||t||!c)return null;const u=c.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,a.selected(u)),u>0?Object(o.createElement)(n.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":a.clear},Object(r.__)("Clear all","woocommerce")):null),u>0?Object(o.createElement)("ul",null,c.map(((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:s}))))):null)},h=({filteredList:e,search:t,onSelect:c,instanceId:n,useExpandedPanelId:s,...u})=>{const{messages:i,renderItem:b,selected:d,isSingle:m}=u,p=b||j;return 0===e.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(a.a,{icon:l.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},t?Object(r.sprintf)(i.noResults,t):i.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(f,{useExpandedPanelId:s,list:e,selected:d,renderItem:p,onSelect:c,instanceId:n,isSingle:m,search:t}))},_=e=>{const{className:t="",isCompact:c,isHierarchical:a,isLoading:l,isSingle:s,list:d,messages:m=b.a,onChange:p,onSearch:g,selected:O,type:j="text",debouncedSpeak:f}=e,[y,k]=Object(o.useState)(""),E=Object(o.useState)(-1),v=Object(i.useInstanceId)(_),S=Object(o.useMemo)((()=>({...b.a,...m})),[m]),x=Object(o.useMemo)((()=>Object(b.c)(d,y,a)),[d,y,a]);Object(o.useEffect)((()=>{f&&f(S.updated)}),[f,S]),Object(o.useEffect)((()=>{"function"==typeof g&&g(y)}),[y,g]);const C=Object(o.useCallback)((e=>()=>{s&&p([]);const t=O.findIndex((({id:t})=>t===e));p([...O.slice(0,t),...O.slice(t+1)])}),[s,O,p]),N=Object(o.useCallback)((e=>()=>{Array.isArray(e)?p(e):-1===O.findIndex((({id:t})=>t===e.id))?p(s?[e]:[...O,e]):C(e.id)()}),[s,C,p,O]),A=Object(o.useCallback)((e=>{const[t]=O.filter((t=>!e.find((e=>t.id===e.id))));C(t.id)()}),[C,O]);return Object(o.createElement)("div",{className:u()("woocommerce-search-list",t,{"is-compact":c,"is-loading":l,"is-token":"token"===j})},"text"===j&&Object(o.createElement)(w,{...e,onRemove:C,messages:S}),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},"text"===j?Object(o.createElement)(n.TextControl,{label:S.search,type:"search",value:y,onChange:e=>k(e)}):Object(o.createElement)(n.FormTokenField,{disabled:l,label:S.search,onChange:A,onInputChange:e=>k(e),suggestions:[],__experimentalValidateInput:()=>!1,value:l?[Object(r.__)("Loading…","woocommerce")]:O.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list"},Object(o.createElement)(n.Spinner,null)):Object(o.createElement)(h,{...e,search:y,filteredList:x,messages:S,onSelect:N,instanceId:v,useExpandedPanelId:E}))};Object(n.withSpokenMessages)(_)},103:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(0);function r(e,t){const c=Object(o.useRef)();return Object(o.useEffect)((()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)}),[e,t]),c.current}},11:function(e,t){e.exports=window.wp.compose},14:function(e,t){e.exports=window.wp.apiFetch},140:function(e,t,c){"use strict";c.d(t,"a",(function(){return u})),c.d(t,"c",(function(){return i})),c.d(t,"b",(function(){return b}));var o=c(0),r=c(1),n=c(70),a=c(275),l=c(211);c(192);const s=({text:e,title:t=Object(r.__)("Feedback?","woocommerce"),url:c="https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565"})=>{const[s,u]=Object(o.useState)(!1);return Object(o.useEffect)((()=>{u(!0)}),[]),Object(o.createElement)(o.Fragment,null,s&&Object(o.createElement)("div",{className:"wc-block-feedback-prompt"},Object(o.createElement)(n.a,{icon:a.a}),Object(o.createElement)("h2",{className:"wc-block-feedback-prompt__title"},t),Object(o.createElement)("p",{className:"wc-block-feedback-prompt__text"},e),Object(o.createElement)("a",{href:c,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(r.__)("Give us your feedback.","woocommerce"),Object(o.createElement)(n.a,{icon:l.a,size:16}))))},u=()=>Object(o.createElement)(s,{text:Object(r.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.","woocommerce"),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"}),i=()=>Object(o.createElement)(s,{text:Object(r.__)("Thanks for trying out the Products block! Help us make it better by sharing your feedback.","woocommerce"),title:Object(r.__)("Share your feedback!","woocommerce"),url:"https://airtable.com/shrFX5FAqmCY6hVYI"}),b=()=>Object(o.createElement)(s,{text:Object(r.__)("Thanks for trying out the Product Collection block! Help us make it better by sharing your feedback.","woocommerce"),title:Object(r.__)("Share your feedback!","woocommerce"),url:"https://airtable.com/shrqsMSDPvAKoY99u"})},142:function(e,t,c){"use strict";c.d(t,"b",(function(){return r})),c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return l}));var o=c(21);const r=e=>Object(o.c)(e,"count")&&Object(o.c)(e,"description")&&Object(o.c)(e,"id")&&Object(o.c)(e,"name")&&Object(o.c)(e,"parent")&&Object(o.c)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,n=e=>Array.isArray(e)&&e.every(r),a=e=>Object(o.c)(e,"attribute")&&Object(o.c)(e,"operator")&&Object(o.c)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every((e=>"string"==typeof e)),l=e=>Array.isArray(e)&&e.every(a)},147:function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),a=c(1),l=c(35),s=c(102),u=c(2),i=c(11),b=c(23),d=c(28),m=c(34),p=c(73),g=c(157);c(233),t.a=Object(i.withInstanceId)((({onChange:e,onOperatorChange:t,instanceId:c,isCompact:r=!1,messages:i={},operator:O="any",selected:j,type:f="text"})=>{const{errorLoadingAttributes:w,isLoadingAttributes:h,productsAttributes:_}=function(e){const[t,c]=Object(o.useState)(null),[r,n]=Object(o.useState)(!1),[a,l]=Object(o.useState)([]),s=Object(o.useRef)(!1);return Object(o.useEffect)((()=>{if(!r&&!s.current)return async function(){n(!0);try{const e=await Object(b.b)(),t=[];for(const c of e){const e=await Object(b.i)(c.id);t.push({...c,parent:0,terms:e.map((e=>({...e,attr_slug:c.taxonomy,parent:c.id})))})}l(t),s.current=!0}catch(e){e instanceof Error&&c(await Object(d.a)(e))}finally{n(!1)}}(),()=>{s.current=!0}}),[r,true]),{errorLoadingAttributes:t,isLoadingAttributes:r,productsAttributes:a}}(),y=_.reduce(((e,t)=>{const{terms:c,...o}=t;return[...e,Object(g.a)(o),...c.map(g.a)]}),[]);return i={clear:Object(a.__)("Clear all product attributes","woocommerce"),noItems:Object(a.__)("Your store doesn't have any product attributes.","woocommerce"),search:Object(a.__)("Search for product attributes","woocommerce"),selected:e=>Object(a.sprintf)(/* translators: %d is the count of attributes selected. */
Object(a._n)("%d attribute selected","%d attributes selected",e,"woocommerce"),e),updated:Object(a.__)("Product attribute search results updated.","woocommerce"),...i},w?Object(o.createElement)(m.a,{error:w}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.a,{className:"woocommerce-product-attributes",isCompact:r,isHierarchical:!0,isLoading:h,isSingle:!1,list:y,messages:i,onChange:e,renderItem:e=>{const{item:t,search:r,depth:s=0}=e,u=["woocommerce-product-attributes__item","woocommerce-search-list__item",{"is-searching":r.length>0,"is-skip-level":0===s&&0!==t.parent}];if(!t.breadcrumbs.length)return Object(o.createElement)(p.a,{...e,className:n()(u),item:t,isLoading:h,disabled:0===t.count,name:`attributes-${c}`,countLabel:Object(a.sprintf)(/* translators: %d is the count of terms. */
Object(a._n)("%d term","%d terms",t.count,"woocommerce"),t.count),"aria-label":Object(a.sprintf)(/* translators: %1$s is the item name, %2$d is the count of terms for the item. */
Object(a._n)("%1$s, has %2$d term","%1$s, has %2$d terms",t.count,"woocommerce"),t.name,t.count)});const i=`${t.breadcrumbs[0]}: ${t.name}`;return Object(o.createElement)(l.a,{...e,name:`terms-${c}`,className:n()(...u,"has-count"),countLabel:Object(a.sprintf)(/* translators: %d is the count of products. */
Object(a._n)("%d product","%d products",t.count,"woocommerce"),t.count),"aria-label":Object(a.sprintf)(/* translators: %1$s is the attribute name, %2$d is the count of products for that attribute. */
Object(a._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woocommerce"),i,t.count)})},selected:j.map((({id:e})=>y.find((t=>t.id===e)))).filter(Boolean),type:f}),!!t&&Object(o.createElement)("div",{hidden:j.length<2},Object(o.createElement)(u.SelectControl,{className:"woocommerce-product-attributes__operator",label:Object(a.__)("Display products matching","woocommerce"),help:Object(a.__)("Pick at least two attributes to use this setting.","woocommerce"),value:O,onChange:t,options:[{label:Object(a.__)("Any selected attributes","woocommerce"),value:"any"},{label:Object(a.__)("All selected attributes","woocommerce"),value:"all"}]})))}))},15:function(e,t){e.exports=window.wp.url},151:function(e,t,c){"use strict";c.d(t,"c",(function(){return u})),c.d(t,"b",(function(){return i})),c.d(t,"a",(function(){return b})),c.d(t,"d",(function(){return d}));var o=c(3),r=c(6),n=c(80);const a=e=>"core/query"===e.name&&"woocommerce/product-query"===e.attributes.namespace,l=e=>"woocommerce/product-collection"===e.name,s=(e,t)=>{let c=[];return e.forEach((e=>{t(e)&&(c=[...c,e.clientId]),c=[...c,...s(e.innerBlocks,t)]})),c},u=e=>s(e,a),i=e=>s(e,l),b=(e,t)=>{const c=Object(r.select)("core/block-editor").getBlockRootClientId(e)||void 0;return Object(r.select)("core/block-editor").canInsertBlockType(t,c)},d=Object(o.getSettingWithCoercion)("postTemplateHasSupportForGridView",!1,n.a)},157:function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return s})),c.d(t,"c",(function(){return u})),c.d(t,"d",(function(){return i}));var o=c(3),r=c(142),n=c(6);const a=Object(o.getSetting)("attributes",[]).reduce(((e,t)=>{const c=(o=t)&&o.attribute_name?{id:parseInt(o.attribute_id,10),name:o.attribute_name,taxonomy:"pa_"+o.attribute_name,label:o.attribute_label}:null;var o;return c&&c.id&&e.push(c),e}),[]),l=e=>{const{count:t,id:c,name:o,parent:n}=e;return{count:t,id:c,name:o,parent:n,breadcrumbs:[],children:[],value:Object(r.b)(e)?e.attr_slug:""}},s=e=>{if(e)return a.find((t=>t.id===e))},u=e=>{if(e)return a.find((t=>t.taxonomy===e))},i=(e,t,c,o)=>{const r=Object(n.select)("core/block-editor"),a=Object(n.dispatch)("core/block-editor"),l=r.getBlockParents(e);let s="";l.forEach((e=>{const t=r.getBlock(e).innerBlocks.find((e=>e.name===o));t&&(s=t.clientId)})),a.updateBlockAttributes(s,{[t]:c})}},16:function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"c",(function(){return s})),c.d(t,"d",(function(){return u})),c.d(t,"b",(function(){return i}));var o=c(0),r=c(1),n=c(57);const a={clear:Object(r.__)("Clear all selected items","woocommerce"),noItems:Object(r.__)("No items found.","woocommerce"),
/* Translators: %s search term */
noResults:Object(r.__)("No results for %s","woocommerce"),search:Object(r.__)("Search for items","woocommerce"),selected:e=>Object(r.sprintf)(/* translators: Number of items selected from list. */
Object(r._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(r.__)("Search results updated.","woocommerce")},l=(e,t=e)=>{const c=e.reduce(((e,t)=>{const c=t.parent||0;return e[c]||(e[c]=[]),e[c].push(t),e}),{}),o=Object(n.a)(t,"id"),r=["0"],a=(e={})=>e.parent?[...a(o[e.parent]),e.name]:e.name?[e.name]:[],l=e=>e.map((e=>{const t=c[e.id];return r.push(""+e.id),{...e,breadcrumbs:a(o[e.parent]),children:t&&t.length?l(t):[]}})),s=l(c[0]||[]);return Object.entries(c).forEach((([e,t])=>{r.includes(e)||s.push(...l(t||[]))})),s},s=(e,t,c)=>{if(!t)return c?l(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map((e=>!!o.test(e.name)&&e)).filter(Boolean);return c?l(r,e):r},u=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map(((e,t)=>c.test(e)?Object(o.createElement)("strong",{key:t},e):Object(o.createElement)(o.Fragment,{key:t},e)))},i=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},17:function(e,t,c){"use strict";c.d(t,"p",(function(){return n})),c.d(t,"n",(function(){return a})),c.d(t,"m",(function(){return l})),c.d(t,"o",(function(){return s})),c.d(t,"k",(function(){return u})),c.d(t,"e",(function(){return i})),c.d(t,"h",(function(){return b})),c.d(t,"l",(function(){return d})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return g})),c.d(t,"a",(function(){return f})),c.d(t,"b",(function(){return w})),c.d(t,"i",(function(){return h})),c.d(t,"j",(function(){return _})),c.d(t,"f",(function(){return y}));var o,r=c(3);const n=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",l=n.pluginUrl+"build/",s=n.buildPhase,u=null===(o=r.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,i=r.STORE_PAGES.checkout.id,b=(r.STORE_PAGES.checkout.permalink,r.STORE_PAGES.privacy.permalink),d=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),m=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),p=r.STORE_PAGES.cart.permalink,g=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("localPickupEnabled",!1)),O=Object(r.getSetting)("countries",{}),j=Object(r.getSetting)("countryData",{}),f=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowBilling)).map((e=>[e,O[e]||""]))),w=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowBilling)).map((e=>[e,j[e].states||[]]))),h=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowShipping)).map((e=>[e,O[e]||""]))),_=Object.fromEntries(Object.keys(j).filter((e=>!0===j[e].allowShipping)).map((e=>[e,j[e].states||[]]))),y=Object.fromEntries(Object.keys(j).map((e=>[e,j[e].locale||[]])))},192:function(e,t){},2:function(e,t){e.exports=window.wp.components},207:function(e,t,c){"use strict";function o(e,t){const{[t]:c,...o}=e;return o}c.d(t,"a",(function(){return o}))},21:function(e,t,c){"use strict";c.d(t,"b",(function(){return r})),c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return a}));var o=c(42);const r=e=>!Object(o.a)(e)&&e instanceof Object&&e.constructor===Object;function n(e,t){return r(e)&&t in e}const a=e=>0===Object.keys(e).length},23:function(e,t,c){"use strict";c.d(t,"h",(function(){return u})),c.d(t,"e",(function(){return i})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return m})),c.d(t,"c",(function(){return p})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var o=c(15),r=c(14),n=c.n(r),a=c(3),l=c(17);const s=(e,t)=>{const c=new Map;return e.filter((e=>{const o=t(e);return!c.has(o)&&(c.set(o,e),!0)}))},u=({selected:e=[],search:t="",queryArgs:c={}})=>{const r=(({selected:e=[],search:t="",queryArgs:c={}})=>{const r=l.p.productCount>100,n={per_page:r?100:0,catalog_visibility:"any",search:t,orderby:"title",order:"asc"},a=[Object(o.addQueryArgs)("/wc/store/v1/products",{...n,...c})];return r&&e.length&&a.push(Object(o.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:e,per_page:0})),a})({selected:e,search:t,queryArgs:c});return Promise.all(r.map((e=>n()({path:e})))).then((e=>{const t=e.flat();return s(t,(e=>e.id)).map((e=>({...e,parent:0})))})).catch((e=>{throw e}))},i=e=>n()({path:`/wc/store/v1/products/${e}`}),b=()=>n()({path:"wc/store/v1/products/attributes"}),d=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=({selected:e=[],search:t})=>{const c=(({selected:e=[],search:t})=>{const c=Object(a.getSetting)("limitTags",!1),r=[Object(o.addQueryArgs)("wc/store/v1/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:t})];return c&&e.length&&r.push(Object(o.addQueryArgs)("wc/store/v1/products/tags",{include:e})),r})({selected:e,search:t});return Promise.all(c.map((e=>n()({path:e})))).then((e=>{const t=e.flat();return s(t,(e=>e.id))}))},p=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:`wc/store/v1/products/categories/${e}`}),O=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter((t=>t.title.raw===e.title.raw)).length;return e.title.raw+(c?"":` - ${e.slug}`)}},231:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(21);const r=e=>{if(Object(o.b)(e)){const t=e.getEditedPostType();return"wp_template"===t||"wp_template_part"===t}return!1}},233:function(e,t){},270:function(e){e.exports=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-collection","version":"1.0.0","title":"Product Collection","description":"Display a collection of products from your store.","category":"woocommerce","keywords":["WooCommerce","Products (Beta)"],"textdomain":"woocommerce","attributes":{"queryId":{"type":"number"},"query":{"type":"object"},"tagName":{"type":"string"},"displayLayout":{"type":"object"},"displayUpgradeNotice":{"type":"boolean","default":false}},"providesContext":{"queryId":"queryId","query":"query","displayLayout":"displayLayout"},"supports":{"align":["wide","full"],"anchor":true,"html":false,"__experimentalLayout":true}}')},28:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}}},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.wp.escapeHtml},34:function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(31);t.a=({error:e})=>Object(o.createElement)("div",{className:"wc-block-error-message"},(({message:e,type:t})=>e?"general"===t?Object(o.createElement)("span",null,Object(r.__)("The following error was returned","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(e))):"api"===t?Object(o.createElement)("span",null,Object(r.__)("The following error was returned from the API","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(e))):e:Object(r.__)("An error has prevented the block from being updated.","woocommerce"))(e))},35:function(e,t,c){"use strict";c.d(t,"a",(function(){return d}));var o=c(0),r=c(4),n=c.n(r),a=c(2);function l(e,t,c){const o=new Set(t.map((e=>e[c])));return e.filter((e=>!o.has(e[c])))}var s=c(10),u=c(16);const i=({label:e})=>Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},e),b=e=>{const{item:t,search:c}=e,r=t.breadcrumbs&&t.breadcrumbs.length;return Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},r?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(u.b)(t.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(u.d)(Object(s.decodeEntities)(t.name),c)))},d=({countLabel:e,className:t,depth:c=0,controlId:r="",item:d,isSelected:m,isSingle:p,onSelect:g,search:O="",selected:j,useExpandedPanelId:f,...w})=>{var h,_;const[y,k]=f,E=null!=e&&void 0!==d.count&&null!==d.count,v=!(null===(h=d.breadcrumbs)||void 0===h||!h.length),S=!(null===(_=d.children)||void 0===_||!_.length),x=y===d.id,C=n()(["woocommerce-search-list__item",`depth-${c}`,t],{"has-breadcrumbs":v,"has-children":S,"has-count":E,"is-expanded":x,"is-radio-button":p}),N=w.name||`search-list-item-${r}`,A=`${N}-${d.id}`,I=Object(o.useCallback)((()=>{k(x?-1:Number(d.id))}),[x,d.id,k]);return S?Object(o.createElement)("div",{className:C,onClick:I,onKeyDown:e=>"Enter"===e.key||" "===e.key?I():null,role:"treeitem",tabIndex:0},p?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("input",{type:"radio",id:A,name:N,value:d.value,onChange:g(d),onClick:e=>e.stopPropagation(),checked:m,className:"woocommerce-search-list__item-input",...w}),Object(o.createElement)(b,{item:d,search:O}),E?Object(o.createElement)(i,{label:e||d.count}):null):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:m,...!m&&d.children.some((e=>j.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:Object(u.d)(Object(s.decodeEntities)(d.name),O),onChange:()=>{m?g(l(j,d.children,"id"))():g(function(e,t,c){const o=l(t,e,"id");return[...e,...o]}(j,d.children))()},onClick:e=>e.stopPropagation()}),E?Object(o.createElement)(i,{label:e||d.count}):null)):Object(o.createElement)("label",{htmlFor:A,className:C},p?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("input",{type:"radio",id:A,name:N,value:d.value,onChange:g(d),checked:m,className:"woocommerce-search-list__item-input",...w}),Object(o.createElement)(b,{item:d,search:O})):Object(o.createElement)(a.CheckboxControl,{id:A,name:N,className:"woocommerce-search-list__item-input",value:Object(s.decodeEntities)(d.value),label:Object(u.d)(Object(s.decodeEntities)(d.name),O),onChange:g(d),checked:m,...w}),E?Object(o.createElement)(i,{label:e||d.count}):null)};t.b=d},42:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>null===e},43:function(e,t){e.exports=window.wp.hooks},5:function(e,t){e.exports=window.wp.blockEditor},54:function(e,t){},55:function(e,t){},552:function(e,t,c){e.exports=c(560)},553:function(e,t){},560:function(e,t,c){"use strict";c.r(t);var o=c(7),r=c(83),n=c(270),a=c(0),l=c(5),s=c(11),u=c(60),i=c(2),b=c(166),d=c(66);const m="woocommerce/product-collection/product-title";!function(e,{blockDescription:t,blockIcon:c,blockTitle:r,variationName:n}){Object(o.registerBlockVariation)(e,{description:t,name:n,title:r,isActive:e=>e.__woocommerceNamespace===n,icon:{src:c},attributes:{__woocommerceNamespace:n},scope:["block","inserter"]})}("core/post-title",{blockDescription:d.a,blockIcon:Object(a.createElement)(i.Icon,{icon:b.a}),blockTitle:d.c,variationName:m});var p=c(1),g=c(43),O=c(140),j=c(6);function f(e,t){const{query:c}=e.attributes;e.setAttributes({query:{...c,...t}})}function w(){const e=Object(j.select)("core/edit-site"),t=null==e?void 0:e.getEditedPostId();return!!t&&["woocommerce/woocommerce//archive-product","woocommerce/woocommerce//taxonomy-product_cat","woocommerce/woocommerce//taxonomy-product_tag","woocommerce/woocommerce//taxonomy-product_attribute","woocommerce/woocommerce//product-search-results"].includes(t)}var h=c(3),_=c(207);const y=Object(h.getSetting)("stockStatusOptions",[]),k=Object(h.getSetting)("hideOutOfStockItems",!1),E=()=>k?Object.keys(Object(_.a)(y,"outofstock")):Object.keys(y),v={perPage:9,pages:0,offset:0,postType:"product",order:"asc",orderBy:"title",author:"",search:"",exclude:[],sticky:"",inherit:null,taxQuery:{},parents:[],isProductCollectionBlock:!0,woocommerceOnSale:!1,woocommerceStockStatus:E(),woocommerceAttributes:[],woocommerceHandPickedProducts:[]},S={query:v,tagName:"div",displayLayout:{type:"flex",columns:3}},x=e=>({...e,orderBy:v.orderBy,order:v.order,inherit:v.inherit}),C=()=>S.displayLayout,N={woocommerceOnSale:v.woocommerceOnSale,woocommerceStockStatus:E(),woocommerceAttributes:[],taxQuery:v.taxQuery,woocommerceHandPickedProducts:[]};var A=e=>{const{displayUpgradeNotice:t}=e.attributes,c=Object(a.createInterpolateElement)(Object(p.__)("Products (Beta) block was upgraded to <strongText />, an updated version with new features and simplified settings.","woocommerce"),{strongText:Object(a.createElement)("strong",null,Object(p.__)("Product Collection","woocommerce"))}),o=Object(p.__)("Revert to Products (Beta)","woocommerce");return t?Object(a.createElement)(i.Notice,{onRemove:()=>{e.setAttributes({displayUpgradeNotice:!1})}},Object(a.createElement)(a.Fragment,null,c," "),Object(a.createElement)("br",null),Object(a.createElement)("br",null),Object(a.createElement)(i.Button,{variant:"link",onClick:()=>{e.revertMigration()}},o)):null},I=e=>{const{type:t,columns:c}=e.displayLayout,o="flex"===t,r=C();return o?Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Columns","woocommerce"),hasValue:()=>(null==r?void 0:r.columns)!==c||(null==r?void 0:r.type)!==t,isShownByDefault:!0,onDeselect:()=>{e.setAttributes({displayLayout:r})}},Object(a.createElement)(i.RangeControl,{label:Object(p.__)("Columns","woocommerce"),value:c,onChange:t=>e.setAttributes({displayLayout:{...e.displayLayout,columns:t}}),min:2,max:Math.max(6,c)})):null},P=c(231),T=c(103);const B=Object(p.__)("Inherit query from template","woocommerce");var L=({setQueryAttribute:e,query:t})=>{const c=null==t?void 0:t.inherit,o=Object(j.select)("core/edit-site"),r=Object(T.a)(t,(e=>!1===(null==e?void 0:e.inherit))),n=Object(a.useMemo)((()=>w()),[]);return Object(P.a)(o)?Object(a.createElement)(i.__experimentalToolsPanelItem,{label:B,hasValue:()=>c!==n,isShownByDefault:!0,onDeselect:()=>{e({inherit:null})}},Object(a.createElement)(i.ToggleControl,{className:"wc-block-product-collection__inherit-query-control",label:B,help:Object(p.__)("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.","woocommerce"),checked:!!c,onChange:t=>{e(t?{...v,inherit:t}:{...v,...r,inherit:t})}})):null};const q=[{label:Object(p.__)("A → Z","woocommerce"),value:"title/asc"},{label:Object(p.__)("Z → A","woocommerce"),value:"title/desc"},{label:Object(p.__)("Newest to oldest","woocommerce"),value:"date/desc"},{label:Object(p.__)("Oldest to newest","woocommerce"),value:"date/asc"},{value:"popularity/desc",label:Object(p.__)("Best Selling","woocommerce")},{value:"rating/desc",label:Object(p.__)("Top Rated","woocommerce")}];var R=e=>{const{query:t,setQueryAttribute:c}=e,{order:o,orderBy:r}=t,n=x(t);return Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Order by","woocommerce"),hasValue:()=>o!==(null==n?void 0:n.order)||r!==(null==n?void 0:n.orderBy),isShownByDefault:!0,onDeselect:()=>{c(n)}},Object(a.createElement)(i.SelectControl,{value:`${r}/${o}`,options:q,label:Object(p.__)("Order by","woocommerce"),onChange:e=>{const[t,o]=e.split("/");c({order:o,orderBy:t})}}))},M=e=>{const{query:t,setQueryAttribute:c}=e;return Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("On Sale","woocommerce"),hasValue:()=>!0===t.woocommerceOnSale,isShownByDefault:!0,onDeselect:()=>{c({woocommerceOnSale:!1})}},Object(a.createElement)(i.ToggleControl,{label:Object(p.__)("Show only products on sale","woocommerce"),checked:t.woocommerceOnSale||!1,onChange:e=>{c({woocommerceOnSale:e})}}))},F=c(116),$=c.n(F);function D(e){var t;const c="string"==typeof e?e:e.value;return null===(t=Object.entries(y).find((([,e])=>e===c)))||void 0===t?void 0:t[0]}var Q=e=>{var t;const{query:c,setQueryAttribute:o}=e;return Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Stock status","woocommerce"),hasValue:()=>!$()(c.woocommerceStockStatus,E()),onDeselect:()=>{o({woocommerceStockStatus:E()})},isShownByDefault:!0},Object(a.createElement)(i.FormTokenField,{label:Object(p.__)("Stock status","woocommerce"),onChange:e=>{const t=e.map(D).filter(Boolean);o({woocommerceStockStatus:t})},suggestions:Object.values(y),validateInput:e=>Object.values(y).includes(e),value:(null==c||null===(t=c.woocommerceStockStatus)||void 0===t?void 0:t.map((e=>y[e])))||[],__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1}))},V=e=>{const{query:t,setQueryAttribute:c}=e,[o,r]=Object(a.useState)(t.search),n=Object(s.useDebounce)((()=>{t.search!==o&&c({search:o})}),250);return Object(a.useEffect)((()=>(n(),n.cancel)),[o,n]),Object(a.createElement)(i.__experimentalToolsPanelItem,{hasValue:()=>!!o,label:Object(p.__)("Keyword","woocommerce"),onDeselect:()=>r(""),resetAllFilter:()=>r("")},Object(a.createElement)(i.TextControl,{label:Object(p.__)("Keyword","woocommerce"),value:o,onChange:r}))},H=c(147);const G=`${h.ADMIN_URL}edit.php?post_type=product&page=product_attributes`;var z=({query:e,setQueryAttribute:t})=>{const c=e.woocommerceAttributes||[],o=null==c?void 0:c.map((({termId:e})=>({id:e})));return Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Product Attributes","woocommerce"),hasValue:()=>!(null==c||!c.length)},Object(a.createElement)(H.a,{messages:{search:Object(p.__)("Attributes","woocommerce")},selected:o||[],onChange:e=>{const c=e.map((({id:e,value:t})=>({termId:e,taxonomy:t})));t({woocommerceAttributes:c})},operator:"any",isCompact:!0,type:"token"}),Object(a.createElement)(i.ExternalLink,{className:"wc-block-editor-product-collection-panel__manage-attributes-link",href:G},Object(p.__)("Manage attributes","woocommerce")))},U=c(79);const W=[],Z={order:"asc",_fields:"id,name,slug",context:"view"},K=(e,t)=>(null==e?void 0:e.id)||t.get(e)||t.get(e.toLocaleLowerCase()),Y=(e,t,c)=>1===c.get(e)?e:`${e} - ${t}`;var J=({taxonomy:e,termIds:t,onChange:c})=>{const[o,r]=Object(a.useState)(void 0),n=Object(a.useRef)(W),l=Object(a.useRef)(W),u=Object(s.useDebounce)(r,250),{termIdToNameMap:b,termNameToIdMap:d,isResolving:m}=(e=>{const{records:t,isResolving:c}=Object(U.useEntityRecords)("taxonomy",e.slug,{...Z});return Object(a.useMemo)((()=>{const e=new Map,o=new Map;if(!t)return{termIdToNameMap:e,termNameToIdMap:o,isResolving:c};const r=(e=>e.reduce(((e,t)=>{const c=t.name;return e.has(c)?e.set(c,e.get(c)+1):e.set(c,1),e}),new Map))(t);for(const c of t){const t=c.id,n=c.name,a=Y(n,c.slug,r);e.set(t,a),o.set(a,t),o.set(a.toLocaleLowerCase(),t)}return{termIdToNameMap:e,termNameToIdMap:o,isResolving:c}}),[t,c])})(e),{records:p,hasResolved:g}=Object(U.useEntityRecords)("taxonomy",e.slug,{...Z,search:o,orderby:"name",exclude:t,per_page:20},{enabled:void 0!==o});n.current=Object(a.useMemo)((()=>g?p.map((e=>b.get(e.id)||e.name)):n.current),[g,p,b]);const{records:O,hasResolved:j}=Object(U.useEntityRecords)("taxonomy",e.slug,{...Z,include:t},{enabled:(null==t?void 0:t.length)>0});return l.current=Object(a.useMemo)((()=>!1===j?l.current:O&&t.length?O.map((({id:e,name:t})=>({id:e,value:b.get(e)||t}))):W),[O,j,b,t]),Object(a.createElement)("div",{className:"wc-block-editor-product-collection-inspector__taxonomy-control"},Object(a.createElement)(i.FormTokenField,{label:e.name,value:l.current,onInputChange:u,suggestions:n.current,onChange:e=>{const t=[];for(const c of e){const e=K(c,d);e&&t.push(e)}c(t)},disabled:m,__experimentalShowHowTo:!1}))},X=function({setQueryAttribute:e,query:t}){const{taxQuery:c}=t,o=Object(j.useSelect)((e=>{const{getTaxonomies:t}=e(U.store);return t({type:"product",per_page:-1,context:"view"})}),[]);return o&&0!==o.length?Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Taxonomies","woocommerce"),hasValue:()=>Object.values(c||{}).some((e=>!!e.length)),onDeselect:()=>e({taxQuery:{}})},o.map((t=>{const o=(null==c?void 0:c[t.slug])||[];return Object(a.createElement)(J,{key:t.slug,taxonomy:t,termIds:o,onChange:o=>e({taxQuery:{...c,[t.slug]:o}})})}))):null},ee=c(23),te=({query:e,setQueryAttribute:t})=>{const c=e.woocommerceHandPickedProducts,{productsMap:o,productsList:r}=function(){const[e,t]=Object(a.useState)(new Map),[c,o]=Object(a.useState)([]);return Object(a.useEffect)((()=>{Object(ee.h)({selected:[]}).then((e=>{const c=new Map;e.forEach((e=>{c.set(e.id,e),c.set(e.name,e)})),o(e),t(c)}))}),[]),{productsMap:e,productsList:c}}(),n=Object(a.useCallback)((e=>{const c=e.reduce(((e,t)=>{const c=o.get(t)||o.get(Number(t));return c&&e.add(String(c.id)),e}),new Set);t({woocommerceHandPickedProducts:Array.from(c)})}),[t,o]),l=Object(a.useMemo)((()=>r.filter((e=>!(null!=c&&c.includes(String(e.id))))).map((e=>e.name))),[r,c]);return Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Hand-picked Products","woocommerce"),hasValue:()=>!(null==c||!c.length),onDeselect:()=>{t({woocommerceHandPickedProducts:[]})}},Object(a.createElement)(i.FormTokenField,{disabled:!o.size,displayTransform:e=>{const t=Number(e);if(Number.isNaN(t))return e;const c=o.get(t);return(null==c?void 0:c.name)||""},label:Object(p.__)("Pick some products","woocommerce"),onChange:n,suggestions:l,__experimentalValidateInput:e=>o.has(e),value:o.size?c||[]:[Object(p.__)("Loading…","woocommerce")],__experimentalExpandOnFocus:!0}))};const ce={who:"authors",per_page:-1,_fields:"id,name",context:"view"};var oe=function({query:e,setQueryAttribute:t}){const c=e.author,{records:o,error:r}=Object(U.useEntityRecords)("root","user",ce);if(r)return Object(a.createElement)(i.__experimentalToolsPanelItem,{label:Object(p.__)("Authors","woocommerce"),hasValue:()=>!0},Object(a.createElement)(i.FormTokenField,{label:Object(p.__)("Authors","woocommerce"),value:[Object(p.__)("Error occurred while loading authors.","woocommerce")],disabled:!0}));if(!o)return null;const n=(e=>{const t=new Map,c=new Map,o=[];return e.forEach((e=>{t.set(Number(e.id),e),c.set(e.name,e),o.push(e.name)})),{authors:e,mapById:t,mapByName:c,names:o}})(o),l=c?c.split(",").map((e=>{const t=n.mapById.get(Number(e));return t?{id:t.id,value:t.name}:null})).filter(Boolean):[];return Object(a.createElement)(i.__experimentalToolsPanelItem,{hasValue:()=>!!c,label:Object(p.__)("Authors","woocommerce"),onDeselect:()=>t({author:""})},Object(a.createElement)(i.FormTokenField,{label:Object(p.__)("Authors","woocommerce"),value:l,suggestions:n.names,onChange:e=>{const c=Array.from(e.reduce(((e,t)=>{const c=((e,t)=>{var c;const o=(null==t?void 0:t.id)||(null===(c=e.get(t))||void 0===c?void 0:c.id);if(o)return o})(n.mapByName,t);return c&&e.add(c),e}),new Set));t({author:c.join(",")})}}))},re=c(645),ne=c(612),ae=e=>{const{type:t,columns:c}=e.displayLayout,o=t=>{e.setAttributes({displayLayout:t})},r=[{icon:re.a,title:Object(p.__)("List view","woocommerce"),onClick:()=>o({type:"list",columns:c}),isActive:"list"===t},{icon:ne.a,title:Object(p.__)("Grid view","woocommerce"),onClick:()=>o({type:"flex",columns:c}),isActive:"flex"===t}];return Object(a.createElement)(i.ToolbarGroup,{controls:r})},le=c(151);const se=e=>{const{query:t,...c}=e,{woocommerceAttributes:o,woocommerceStockStatus:r,woocommerceOnSale:n,woocommerceHandPickedProducts:a,taxQuery:l,parents:s,isProductCollectionBlock:u,...i}=t,b={...i};return a&&(b.include=a),n&&(b.__woocommerceOnSale=n),{...c,namespace:"woocommerce/product-query",query:{__woocommerceAttributes:o||[],__woocommerceStockStatus:r||[],...b}}},ue=e=>"flex"===e?"grid":"list"===e?"default":"grid",ie=e=>{const{type:t,columns:c}=e;return{type:ue(t),columnCount:c}},be=(e,t)=>{const c=e.map((e=>{const{name:c,attributes:r}=e,n=be(e.innerBlocks);return(({name:e})=>"woocommerce/product-template"===e)(e)?((e,t,c)=>Object(o.createBlock)("core/post-template",{className:"products-block-post-template",layout:le.d?ie(c):void 0,__woocommerceNamespace:"woocommerce/product-query/product-template",...e.attributes},t))(e,n,t):(({name:e,attributes:t})=>"core/post-title"===e&&"woocommerce/product-collection/product-title"===t.__woocommerceNamespace)(e)?((e,t)=>{const{__woocommerceNamespace:c,...r}=e.attributes;return Object(o.createBlock)("core/post-title",{__woocommerceNamespace:"woocommerce/product-collection/product-title",...r},t)})(e,n):(({name:e,attributes:t})=>"core/post-excerpt"===e&&"woocommerce/product-collection/product-summary"===t.__woocommerceNamespace)(e)?((e,t)=>{const{__woocommerceNamespace:c,...r}=e.attributes;return Object(o.createBlock)("core/post-excerpt",{__woocommerceNamespace:"woocommerce/product-collection/product-summary",...r},t)})(e,n):Object(o.createBlock)(c,r,n)}));return c},de=e=>{const t=Object(j.select)("core/block-editor").getBlock(e),c=Object(le.a)(e,"core/query");if(t&&c){const{attributes:c={},innerBlocks:r=[]}=t,{displayLayout:n,...a}=c,l=le.d?se(a):se(c),s=be(r,n),u=Object(o.createBlock)("core/query",l,s);return Object(j.dispatch)("core/block-editor").replaceBlock(e,u),!0}return!1},me=()=>{const e=Object(j.select)("core/block-editor").getBlocks();Object(le.b)(e).map(de)};var pe=e=>{const t=e.attributes.query,c=!1===(null==t?void 0:t.inherit),o=Object(a.useMemo)((()=>f.bind(null,e)),[e]),r={setAttributes:e.setAttributes,displayLayout:e.attributes.displayLayout},n={setQueryAttribute:o,query:t};return Object(a.createElement)(l.InspectorControls,null,Object(a.createElement)(l.BlockControls,null,Object(a.createElement)(ae,{...r})),Object(a.createElement)(i.__experimentalToolsPanel,{label:Object(p.__)("Settings","woocommerce"),resetAll:()=>{const t=(c=e.attributes,{displayLayout:C(),query:x(c.query)});var c;e.setAttributes(t)}},Object(a.createElement)(I,{...r}),Object(a.createElement)(L,{...n}),c?Object(a.createElement)(R,{...n}):null),c?Object(a.createElement)(i.__experimentalToolsPanel,{label:Object(p.__)("Filters","woocommerce"),resetAll:t=>{f(e,N),t.forEach((e=>e()))},className:"wc-block-editor-product-collection-inspector-toolspanel__filters"},Object(a.createElement)(M,{...n}),Object(a.createElement)(Q,{...n}),Object(a.createElement)(te,{...n}),Object(a.createElement)(V,{...n}),Object(a.createElement)(z,{...n}),Object(a.createElement)(X,{...n}),Object(a.createElement)(oe,{...n})):null,Object(a.createElement)(O.b,null))};Object(g.addFilter)("editor.BlockEdit","woocommerce/product-collection",(e=>t=>t.name===n.name?Object(a.createElement)(a.Fragment,null,Object(a.createElement)(l.InspectorControls,null,t.attributes.displayUpgradeNotice&&Object(a.createElement)(A,{...t,revertMigration:me})),Object(a.createElement)(e,{...t})):Object(a.createElement)(e,{...t}))),c(553);var ge=c(652);const Oe=({onToggle:e})=>Object(a.createElement)(i.ToolbarButton,{icon:ge.a,label:Object(p.__)("Display settings","woocommerce"),onClick:e});var je=({query:e,setQueryAttribute:t})=>{const c=e=>{const c=Number(e);!isNaN(c)&&c>=1&&c<=100&&t({perPage:c})},o=e=>{const c=Number(e);!isNaN(c)&&c>=0&&c<=100&&t({offset:c})},r=e=>{const c=Number(e);!isNaN(c)&&c>=0&&t({pages:c})},n={__unstableInputWidth:"60px",labelPosition:"edge",step:"1",isDragEnabled:!1};return Object(a.createElement)(i.ToolbarGroup,null,Object(a.createElement)(i.Dropdown,{contentClassName:"wc-block-editor-product-collection__display-settings",renderToggle:({onToggle:e})=>Object(a.createElement)(Oe,{onToggle:e}),renderContent:()=>Object(a.createElement)(a.Fragment,null,Object(a.createElement)(i.__experimentalNumberControl,{...n,label:Object(p.__)("Items per Page","woocommerce"),min:1,max:100,onChange:c,value:e.perPage}),Object(a.createElement)(i.__experimentalNumberControl,{...n,label:Object(p.__)("Offset","woocommerce"),min:0,max:100,onChange:o,value:e.offset}),Object(a.createElement)(i.BaseControl,{help:Object(p.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).","woocommerce"),id:"woocommerce-products-block__display-settings-pages"},Object(a.createElement)(i.__experimentalNumberControl,{...n,label:Object(p.__)("Max page to show","woocommerce"),min:0,onChange:r,value:e.pages})))}))};function fe(e){const t=e.attributes.query,c=Object(a.useMemo)((()=>f.bind(null,e)),[e]);return Object(a.createElement)(l.BlockControls,null,!t.inherit&&Object(a.createElement)(je,{query:t,setQueryAttribute:c}))}const we=[["woocommerce/product-template",{},[["woocommerce/product-image",{imageSizing:u.a.THUMBNAIL}],["core/post-title",{textAlign:"center",level:3,fontSize:"medium",style:{spacing:{margin:{bottom:"0.75rem",top:"0"}}},isLink:!0,__woocommerceNamespace:m}],["woocommerce/product-price",{textAlign:"center",fontSize:"small"}],["woocommerce/product-button",{textAlign:"center",fontSize:"small"}]]],["core/query-pagination",{layout:{type:"flex",justifyContent:"center"}}],["core/query-no-results"]],he=e=>{var t;const{attributes:c,setAttributes:o}=e,{queryId:r}=c,n=Object(l.useBlockProps)(),u=Object(l.useInnerBlocksProps)(n,{template:we}),i=Object(s.useInstanceId)(he);return Object(a.useEffect)((()=>{Number.isFinite(r)||o({queryId:Number(i)})}),[r,i,o]),Object(a.useEffect)((()=>{o({...S,query:{...S.query,inherit:w()},...c})}),[o]),"boolean"!=typeof(null==c||null===(t=c.query)||void 0===t?void 0:t.inherit)?null:Object(a.createElement)("div",{...n},Object(a.createElement)(pe,{...e}),Object(a.createElement)(fe,{...e}),Object(a.createElement)("div",{...u}))};var _e=he;Object(r.a)()&&Object(o.registerBlockType)(n,{icon:()=>Object(a.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 11H5C4.72386 11 4.5 11.2239 4.5 11.5V17.5C4.5 17.7761 4.72386 18 5 18H19C19.2761 18 19.5 17.7761 19.5 17.5V11.5C19.5 11.2239 19.2761 11 19 11ZM5 9.5H19C20.1046 9.5 21 10.3954 21 11.5V17.5C21 18.6046 20.1046 19.5 19 19.5H5C3.89543 19.5 3 18.6046 3 17.5V11.5C3 10.3954 3.89543 9.5 5 9.5Z",fill:"currentColor"}),Object(a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 7.5C18 7.77614 17.7761 8 17.5 8L6.5 8C6.22386 8 6 7.77614 6 7.5V7.5C6 7.22386 6.22386 7 6.5 7L17.5 7C17.7761 7 18 7.22386 18 7.5V7.5Z",fill:"currentColor"}),Object(a.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 5C16 5.27614 15.7761 5.5 15.5 5.5L8.5 5.5C8.22386 5.5 8 5.27614 8 5V5C8 4.72386 8.22386 4.5 8.5 4.5L15.5 4.5C15.7761 4.5 16 4.72386 16 5V5Z",fill:"currentColor"})),edit:_e,save:function({attributes:{tagName:e="div"}}){const t=l.useBlockProps.save(),c=l.useInnerBlocksProps.save(t);return Object(a.createElement)(e,{...c})}})},57:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=(e,t)=>e.reduce(((e,c)=>(e[String(t?c[t]:c)]=c,e)),{})},6:function(e,t){e.exports=window.wp.data},60:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));let o=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({})},66:function(e,t,c){"use strict";c.d(t,"c",(function(){return l})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return u}));var o=c(0),r=c(1),n=c(70),a=c(166);const l=Object(r.__)("Product Title","woocommerce"),s=Object(o.createElement)(n.a,{icon:a.a,className:"wc-block-editor-components-block-icon"}),u=Object(r.__)("Display the title of a product.","woocommerce")},7:function(e,t){e.exports=window.wp.blocks},73:function(e,t,c){"use strict";var o=c(0),r=c(2),n=c(35),a=c(4),l=c.n(a);t.a=({className:e,item:t,isSelected:c,isLoading:a,onSelect:s,disabled:u,...i})=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(n.a,{...i,key:t.id,className:e,isSelected:c,item:t,onSelect:s,disabled:u}),c&&a&&Object(o.createElement)("div",{key:"loading",className:l()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(o.createElement)(r.Spinner,null)))},79:function(e,t){e.exports=window.wp.coreData},80:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>"boolean"==typeof e},83:function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return l}));var o=c(7),r=c(17);const n=(e,t)=>{if(r.o>2)return Object(o.registerBlockType)(e,t)},a=()=>r.o>2,l=()=>r.o>1},9:function(e,t){e.exports=window.wp.primitives}});